package teste;

import br.com.post.model.Profile;
import br.com.post.model.User;
import br.com.post.persistence.ProfileDao;


public class Main {
	
	public static void main(String[] args) {
		/*
		//User user = new User();
		//UserDao userDB = new UserDao();
		//userDB.createUser(user);
		Session session = HibernateUtil.getSession();
		org.hibernate.Transaction tx = session.beginTransaction();
		User user = (User) session.get(User.class, new Long(2));
		tx.commit();
		session.close();
		System.out.println("\n"+user.getUser_name());
		System.out.println("\n"+user.getUser_schooling().getSchooling_description());
		*/
		ProfileDao profiledao = ProfileDao.getInstance();
		Profile profile = profiledao.selectProfileWithUsers(1);
		for (User user : profile.getProfile_list_user()) {
			System.out.println(user.getUser_name());
		}
	}

}
